package com.zzg.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.zzg.util.result.ResultUtil;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;

@Api(value = "错误",description = "错误页面处理")
@Controller
@Slf4j
public class ErrorController {
	 /***
     * 错误页面
     * @param model
     * @return
     */
    @ApiOperation(
            value = "错误页面",
            notes = "错误页面",
            produces="application/json, application/xml",
            consumes="application/json, application/xml")
    @RequestMapping("/error1")
    public ModelAndView error1(Model model, HttpServletResponse response, HttpServletRequest request){
        log.info("[hope-error1-page]-[{}]","错误页面");
        response.setStatus(HttpStatus.FORBIDDEN.value());
        return ResultUtil.view("common/error/010");
    }

}
